//using Microsoft.VisualBasic;
using System;

//
// *  NHibernate 代码模版
// 

using System.Collections.Generic;

namespace NCS_CS
{
	/// <summary>
	///	
	/// </summary>
	[Serializable()]
	public class SampleAve
	{

		#region "构造方法"
		public SampleAve()
		{
			m_sessionid = 0;
			m_sampleid = 0;
			m_c = 0;
			m_s = 0;
			m_mdate = DateTime.Now;
			m_name = null;
			m_user = null;
			m_methodid = 0;
			m_num =0;
            m_cstd = Double.NaN;

            m_sstd = Double.NaN;
		}
		#endregion


		#region "私有变量"
		private int m_sessionid;
		private int m_sampleid;
		private double m_c;
		private double m_s;
		private DateTime m_mdate;
		private string m_name;
		private string m_user;
		private int m_methodid;
		private long m_num;
		private double m_cstd;

		private double m_sstd;
		#endregion


		#region "公有属性"

		///<summary>
		///
		///</summary>
		public virtual int sessionid {
			get { return m_sessionid; }
			set { m_sessionid = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual int sampleid {
			get { return m_sampleid; }
			set { m_sampleid = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual double c {
			get { return m_c; }
			set { m_c = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual double s {
			get { return m_s; }
			set { m_s = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual DateTime mdate {
			get { return m_mdate; }
			set { m_mdate = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual string name {
			get { return m_name; }
			set { m_name = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual string user {
			get { return m_user; }
			set { m_user = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual int methodid {
			get { return m_methodid; }
			set { m_methodid = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual long num {
			get { return m_num; }
			set { m_num = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual double cstd {
			get { return m_cstd; }
			set { m_cstd = value; }
		}
		///<summary>
		///
		///</summary>
		public virtual double sstd {
			get { return m_sstd; }
			set { m_sstd = value; }
		}
		public virtual double crsd {
			get {
				if (m_c != 0) {
					return m_cstd / m_c * 100;
				} else {
					return 0;
				}
			}
		}
		//Set(ByVal value As Double)
		//End Set
		public virtual double srsd {
			get {
				if (m_s != 0) {
					return m_sstd / m_s * 100;
				} else {
					return 0;
				}
			}
		}
		//Set(ByVal value As Double)
		//End Set

		#endregion

		#region "Rewrite Equals and HashCode"
		/// <summary>
		/// 
		/// </summary>
		public override bool Equals(object obj)
		{
			if (object.ReferenceEquals(this, obj)) {
				return true;
			}
			if ((obj == null) || (!object.ReferenceEquals(obj.GetType(), GetType()))) {
				return false;
			}
			SampleAve castObj = (SampleAve)obj;
			return (castObj != null) && (m_sampleid == castObj.sampleid);
		}
		/// <summary>
		/// 用唯一值实现GetHashCode
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * m_sampleid.GetHashCode();
			return hash;
		}
		#endregion
	}
}
